fn main() {
    println!("Hello, world!");

    //
    // let string1 = String::from("long string is long");

    {
        let string1 = String::from("long string is long");
        let string2 = String::from("xyz");
        let result = longest(string1.as_str(), string2.as_str());
        println!("The longest string is {}", result);
    }//
}

// fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
//     if x.len() > y.len() {
//         x
//     } else {
//         y
//     }
// }
//expected named lifetime parameter
fn longest(x: & str, y: & str) -> &str {
    if x.len() > y.len() {
        x
    } else {
        y
    }
}

